var do_Page = sm("do_Page");
var root = ui("$");
var tabCircleText = ui("tabCircleText");
var tabCircleBg = ui("tabCircleBg");
var tabNeighboursText = ui("tabNeighboursText");
var tabNeighboursBg = ui("tabNeighboursBg");
var menuNeighbours = ui("menuNeighbours");
var tagsData = mm("do_ListData");
//点击邻里动态
ui("tabCircle").on("touch",'',1000,function(data){
	tabStyle(true);
	do_Page.fire("community_newIndex_tab",{tabType:"circle"});
})
//点击邻里动态
ui("tabNeighbours").on("touch",'',1000,function(data){
	tabStyle(false);
	do_Page.fire("community_newIndex_tab",{tabType:"communityMessage"});
})
//变换top的社区
do_Page.on("initTopCell", function(data) {
	menuNeighbours.visible=data.isCommunityMessage;
	menuNeighbours.tag=data.tagList;
	menuNeighbours.bindItems(tagsData);
	tagsData.addData(data.tagList);
	tabStyle(!data.isCommunityMessage);
	menuNeighbours.refreshItems();
});

function tabStyle(flag){
	if(flag){
		tabCircleText.fontColor="ff5305FF";
		tabNeighboursText.fontColor="949EAAFF";
		tabCircleBg.bgColor="ff5305FF";
		tabNeighboursBg.bgColor = "00000000";
	}
	else{
		tabCircleText.fontColor="949EAAFF";
		tabNeighboursText.fontColor="ff5305FF";
		tabCircleBg.bgColor="00000000";
		tabNeighboursBg.bgColor = "ff5305FF";
	}
}